const api = require('./index')

import { base } from './base'
import baseOnline from './baseOnline'

const official = base + 'inclusion-official/'
const system = base + 'inclusion-system/'
const solr = base + 'inclusion-solr/'
const business = baseOnline + 'business/'
const onlineSystem = baseOnline + 'system/'
const datahandle = baseOnline + 'datahandle/'

module.exports = {
    getZdType: (type) => { // 用type获取字典
        return api.get(system + 'dict/queryListByType/' + type)
    },
    getZdCode: (code) => { // 用code获取字典
        return api.get(system + 'dict/queryListByType/' + code)
    },
    getJson: (code, fn) => { // 获取JSON串
        return api.get(system + 'setting/getByCode/' + code).then(res => {
            fn(res && res.data && res.data.content ? JSON.parse(res.data.content) : '')
        })
    },

    guestList: (year) => { // 查询官网web前端首页嘉宾
        return api.get(official + 'webHome/guestList/' + year)
    },
    trendsList: (data) => { // 查询官网web前端首页大会动态资讯
        return api.post(official + 'webHome/trendsList', data)
    },
    exhibitionPhotosList: (data) => { // 查询官网web前端科技展览直击现场图片
        return api.post(official + 'webForum/exhibitionPhotosList', data)
    },
    exhibitionDetail: () => { // 查询官网web前端科技展览详情
        return api.get(official + 'webForum/exhibitionDetail')
    },
    webSpecialActivitiesList: () => { // 查询官网web前端特色活动
        return api.get(official + 'webSpecialActivities/list')
    },
    greenFairDetail: () => { // 查询官网web前端特色活动 绿色集市详情
        return api.get(official + `webSpecialActivities/greenFairDetail`)
    },
    jobFairDetail: () => { // 查询官网web前端特色活动 科技招聘会详情
        return api.get(official + `webSpecialActivities/jobFairDetail`)
    },
    sponsorList: () => { // 查询官网web前端赞助商合作伙伴 赞助商列表
        return api.get(official + `webSponsorPartners/sponsorList`)
    },
    sponsorDetail: (uuid) => { // 查询官网web前端赞助商合作伙伴 赞助商详情
        return api.get(official + `webSponsorPartners/sponsorDetail/${uuid}`)
    },
    partnersList: () => { // 查询官网web前端赞助商合作伙伴 合作伙伴列表
        return api.get(official + `webSponsorPartners/partnersList`)
    },
    partnersDetail: (uuid) => { // 查询官网web前端赞助商合作伙伴 合作伙伴详情
        return api.get(official + `webSponsorPartners/partnersDetail/${uuid}`)
    },
    newsList: (data) => { // 查询官网web前端媒体新闻列表
        return api.post(official + 'webMedia/newsList', data)
    },
    insightsTrendsList: (data) => { // 查询官网web前端媒体见解趋势列表
        return api.post(official + 'webMedia/insightsTrendsList', data)
    },
    videoList: (data) => { // 查询官网web前端媒体大会视频列表
        return api.post(official + 'webMedia/videoList', data)
    },
    newsDetail: (uuid) => { // 查询官网web前端媒体新闻详情
        return api.get(official + `webMedia/newsDetail/${uuid}`)
    },
    insightsTrendsDetail: (uuid) => { // 官网web前端媒体见解趋势详情
        return api.get(official + `webMedia/insightsTrendsDetail/${uuid}`)
    },
    videoDetail: (uuid) => { // 官网web前端媒体大会视频详情
        return api.get(official + `webMedia/videoDetail/${uuid}`)
    },
    listTab: (year) => { // 查询官网web前端论坛列表tab
        return api.get(official + `webForum/listTab/` + year)
    },
    webForumList: (data) => { // 查询官网web前端论坛列表
        return api.post(official + 'webForum/list', data)
    },
    webForumDetail: (uuid) => { // 查询官网web前端论坛详情
        return api.get(official + `webForum/detail/${uuid}`)
    },
    mainDetail: (year = '2024') => { // 查询官网web前端主论坛详情
        return api.get(official + `webForum/mainDetail/` + year)
    },
    photosList: (data) => { // 查询官网web前端论坛直击现场图片
        return api.post(official + 'webForum/photosList', data)
    },
    agendaList: (data) => { // 查询官网web前端日程
        return api.post(official + 'webForum/agendaList', data)
    },
    liveList: (data) => { // 查询官网web前端直播列表
        return api.post(official + 'webLive/liveList', data)
    },
    momentsList: (data) => { // 查询官网web前端精彩瞬间列表
        return api.post(official + 'webLive/momentsList', data)
    },
    technologyExhibitionList: (data) => { // 查询科技展览抢先看列表
        return api.post(official + 'web/technology/exhibition/list', data)
    },
    technologyExhibitionDetail: (uuid) => { // 查询科技展览抢先看详情
        return api.get(official + `web/technology/exhibition/detail/${uuid}`)
    },
    technologyExhibitionPartnersList: () => { // 查询官网web前端科技展览合作伙伴 合作伙伴列表
        return api.get(official + `webSponsorPartners/technologyExhibitionPartnersList`)
    },
    greenLiangdianDetail: (uuid) => { // 查询绿色活动亮点详情
        return api.get(official + `web/green/fair/detail/${uuid}`)
    },
    greenFairList: (data) => { // 查询绿色活动亮点列表
        return api.post(official + 'web/green/fair/list', data)
    },
    greenFairPhotosList: (data) => { // 查询官网web前端绿色活动直击现场图片
        return api.post(official + 'web/green/fair/photosList', data)
    },
    achievementDetail: () => { // 查询官网创新成功展
        return api.get(official + `web/innovation/achievement/detail`)
    },
    activityDetail: (uuid) => { // 查询官网web前端活动详情
        return api.get(official + `web/activity/detail/${uuid}`)
    },
    activityList: (data) => { // 查询官网web前端活动列表
        return api.post(official + 'web/activity/list', data)
    },
    activityPhotosList: (data) => { // 查询官网web前端活动直击现场图片
        return api.post(official + 'web/activity/photosList', data)
    },
    gwMobileLogin: (data) => { // 官网手机登录
        return api.post(business + 'online/login/gwMobileLogin', data)
    },
    getTimestamp: () => { // 获取服务器时间
        return api.get(business + `online/login/getTimestamp`)
    },
    getSmsCode: (data) => { // 获取短信验证码
        return api.post(business + 'online/login/getGwSmsCode', data)
    },
    getOnlineZdCode: (code) => { // 用code获取字典
        return api.get(onlineSystem + 'register/dict/queryListByType/' + code)
    },
    certDetail: () => { // 查询用户凭证详情
        return api.get(business + 'online/person/certDetail')
    },
    queryActivityList: (data) => { // 查询活动列表
        return api.post(business + 'online/activity/queryActivityList', data)
    },
    reserActivityvation: (activityUuid, appointTimeUuid) => { // 活动预约
        return api.put(business + `online/activity/reservation/${activityUuid}/${appointTimeUuid}`)
    },
    searchList: (data) => { // 搜索
        return api.post(business + 'online/search/list', data)
    },
    zcGzDetail(code){
        return api.get(business + `/online/protocol/detail/${code}`)
    },
    queryActivityDetail(activityUuid){ // 查询活动详情
        return api.get(business + `/online/activity/queryActivityDetail/${activityUuid}`)
    },
    exitLogin: () => { // 退出登录
        return api.get(business + `online/login/exitLogin`)
    },
    queryGuestDirectoryList: (data) => { // 查询大会嘉宾名录
        return api.post(business + 'online/person/queryGuestDirectoryList', data)
    },
    prevPhotosList: (data) => { // 查询官网web往届精彩瞬间
        return api.post(official + 'web/previous/highlights/photosList', data)
    },
    prevHighlightsList: (data) => { // 查询官网往届亮点列表
        return api.post(official + 'web/previous/highlights/list', data)
    },
    prevHighlightsDetail: (uuid) => { // 查询官网往届亮点详情
        return api.get(official + `web/previous/highlights/detail/${uuid}`)
    },
    prevMainForum: (year) => { // 查询官网往届主论坛
        return api.get(official + `web/previous/highlights/mainForum/${year}`)
    },
    webApplyAdd: (data) => { // 新增参会申请
        return api.post(official + `webApply/official/attend/apply/add`, data)
    },
    queryAreaList: (parentUuid) => { // 根据父节点查询所有国家地区，根节点传-1
        return api.get(onlineSystem + `tenant/area/queryAreaList/${parentUuid}`)
    },
    questionnairesubmitAnswer: (data) => { // 提交问卷答案
        return api.post(business + 'online/questionnaire/submitAnswer', data)
    },
    questionnairedetail: (uuid) => { // 查询问卷信息详情
        return api.get(business + `online/questionnaire/detail/${uuid}`)
    },
    uploadPic(params) { // 文件上传
        return api.postUrl(onlineSystem + 'online/file/uploadFile', params)
    },
    enrolladd: (data) => { // 新增创新者舞台报名
        return api.post(business + 'online/innovator/enroll/add', data)
    },
    aiEnrolladd: (data) => { // AI科创赛报名
        return api.post(business + 'online/ai/innovate/enroll/add', data)
    },
    queryListByDictTypeList: (data) => { // 根据字典类型列表查询字典数据集合
        return api.post(onlineSystem + 'online/dict/queryListByDictTypeList', data)
    },
    gwCheckIdentityCard: (data) => { // 线上平台官网注册校验证件号后四位
        return api.post(business + 'online/major/person/gwCheckIdentityCard', data)
    },
    gwRegister: (data) => { // 线上平台官网专业观众注册
        return api.post(business + 'online/major/person/gwRegister', data)
    },
    gwRegisterVerify: (data) => { // 线上平台官网注册验证码校验
        return api.post(business + 'online/major/person/gwRegisterVerify', data)
    },
    invitationcheckIdentityCard: (data) => { // 线上平台邀约注册校验证件号后四位
        return api.post(business + 'online/invitation/register/checkIdentityCard', data)
    },
    invitationconvert: (inviteCode) => { // 线上平台邀约身份转换
        return api.post(business + `online/invitation/register/convert/${inviteCode}`)
    },
    invitationregister: (data) => { // 线上平台邀约注册
        return api.post(business + 'online/invitation/register/register', data)
    },
    invitationsignUpForum: (inviteCode) => { // 线上平台邀约报名论坛
        return api.post(business + `online/invitation/register/signUpForum/${inviteCode}`)
    },
    invitationsubmit: (data) => { // 线上平台邀约注册提交手机号、邀请码
        return api.post(business + 'online/invitation/register/submit', data)
    },
    personidentityVerification: (data) => { // 人证核验
        return api.post(business + 'online/person/identityVerification', data)
    },
    invitecodejump: (data) => { // 链接跳转
        return api.post(business + 'online/cert/invite/code/jump', data)
    },
    meetupenrolladd: (data) => { // 新增Meetup报名
        return api.post(business + 'online/meetup/enroll/add', data)
    },
    webSpecialActivitiesphotosList: (data) => { // 查询官网web前端科技招聘会活动直击现场图片
        return api.post(official + 'webSpecialActivities/photosList', data)
    },
    alipayLogin: (data) => { // 支付宝小程序登录
        return api.post(business + 'online/login/alipayLogin', data)
    },
    weChatLogin: (code) => { // 微信小程序登录
        return api.post(business + 'online/login/weChatLogin/' + code)
    },
	
	// 线上平台/用户在线交流名片 : Online Person Business Card ControllerShow/HideList OperationsExpand Operations
    businesscardadd: (data) => { // 新增用户在线交流名片
        return api.post(business + `online/person/business/card/add`, data)
    },
    businesscarddetailById: (uuid) => { // 根据ID查询用户在线交流名片详情
        return api.get(business + `online/person/business/card/detailById/${uuid}`)
    },
    businesscarddetail: () => { // 查询用户在线交流名片详情
        return api.get(business + `online/person/business/card/detail`)
    },
    businesscardlist: (data) => { // 查询用户在线交流名片列表
        return api.post(business + `online/person/business/card/list`, data)
    },
    businesscardupdate: (data) => { // 修改用户在线交流名片
        return api.put(business + `online/person/business/card/update`, data)
    },
    businesscardupdateExchangeStatus: (status) => { // 修改用户在线交流 状态
        return api.put(business + `online/person/business/card/updateExchangeStatus/${status}`)
    },
    businesscardupdateShowDirectionStatus: (status) => { // 修改用户在线交流是否展示参会目的状态
        return api.put(business + `online/person/business/card/updateShowDirectionStatus/${status}`)
    },
	
	// 线上平台/在线交流线下会面 : Online Offline Meeting ControllerShow/HideList OperationsExpand Operations
    offlinemeetinglist: (data) => { // 查询在线交流线下会面列表
        return api.post(business + `online/offline/meeting/list`, data)
    },
    offlineupdateStatus: (uuid, acceptStatus) => { // 接受、拒绝线下会面
        return api.post(business + `online/offline/meeting/updateStatus/${uuid}/${acceptStatus}`)
    },
	
	
	
	clearUnReadMsg: (data) => { // 清除未读消息
	    return api.post(business + `online/chat/clearUnReadMsg`, data)
	},
	getChatRoomId: (friendUuid) => { // 获取聊天房间ID
	    return api.get(business + `online/chat/getChatRoomId/${friendUuid}`)
	},
	queryChatHistoryRecord: (data) => { // 获取聊天历史记录
	    return api.post(business + `online/chat/queryChatHistoryRecord`, data)
	},
	queryChatUnReadNum: () => { // 查询聊天未读消息数量
	    return api.get(business + `online/chat/queryChatUnReadNum`)
	},
	queryChatWindow: (data) => { // 查询聊天会话窗口
	    return api.post(business + `online/chat/queryChatWindow`, data)
	},
	sendCallingCard: (type, receiverMemberUuid) => { // 发送会员名片
	    return api.post(business + `online/chat/sendCallingCard/${ type }/${receiverMemberUuid}`)
	},
	sendMsg: (data) => { // 发送会话聊天
	    return api.post(business + `online/chat/sendMsg`, data)
	},
	callingCard: (data) => { // 查询名片列表
	    return api.post(business + `client/calling/card/list`, data)
	},
	deleteCard: (uuid) => { // 删除名片
	    return api.deleteFetch(business + `client/calling/card/delete/${uuid}`)
	},
	applyOfflineMeeting: (data) => { // 申请线下会面
	    return api.post(business + `online/chat/applyOfflineMeeting`, data)
	},
	
	// 线上平台/论坛预约 : Forum Online ControllerShow/HideList OperationsExpand Operations
	cancelJoinTrip: (forumUuid) => { // 论坛取消行程
	    return api.deleteUrl(business + `online/forum/cancelJoinTrip/${forumUuid}`)
	},
	cancelReservation: (forumUuid) => { // 论坛取消预约
	    return api.deleteUrl(business + `online/forum/cancelReservation/${forumUuid}`)
	},
	changeReservation: (forumUuid) => { // 更换论坛预约
	    return api.put(business + `online/forum/changeReservation/${forumUuid}`)
	},
	joinTrip: (forumUuid) => { // 论坛加入行程
	    return api.put(business + `online/forum/joinTrip/${forumUuid}`)
	},
	queryForumDetail: (forumUuid) => { // 查询论坛详情
	    return api.put(business + `online/forum/queryForumDetail/${forumUuid}`)
	},
    queryForumList: (data) => { // 查询论坛列表
        return api.post(business + 'online/forum/queryForumList', data)
    },
    queryReservationStatusList: (data) => { // 查询论坛预约状态(2025年使用)
        return api.post(business + 'online/forum/queryReservationStatusList', data)
    },
	reservation: (forumUuid) => { // 论坛预约
	    return api.put(business + `online/forum/reservation/${forumUuid}`)
	},
    queryMyTripTime: () => { // 我的行程时段查询
        return api.get(business + `online/trip/queryMyTripTime`)
    },
    queryTripList: (data) => { // 查询行程列表
        return api.post(business + 'online/trip/queryTripList', data)
    },
    queryForumTripList: (data) => { // 查询论坛行程列表(已预约的行程)
        return api.post(business + 'online/trip/queryForumTripList', data)
    },
    generateQrCode: () => { // 生成二维码 返回base64
        return api.get(business + `online/person/generateQrCode`)
    },
    getSendStatus: (roomId, friendUuid) => { // 查询消息可发送状态
        return api.get(business + `online/chat/getSendStatus/${roomId}/${friendUuid}`)
    },
    queryChatWindow: (data) => { // 消息中心
        return api.post(business + 'online/chat/queryChatWindow', data)
    },
    queryChatUnReadNum: () => { // 查询聊天未读消息数量
        return api.get(business + `online/chat/queryChatUnReadNum`)
    },
    messagemyList: (data) => { // 查询我的行程提醒列表
        return api.post(business + 'online/mail/message/myList', data)
    },
    messagemymyUnReadList: (data) => { // 查询我的行程提醒未读列表
        return api.post(business + 'online/mail/message/myUnReadList', data)
    },
    messagemymyread: (uuid) => { // 读取行程提醒
        return api.get(business + `online/mail/message/read/${uuid}`)
    },
	
	
	iifaahostedVp: (data) => { // 托管vp校验（推荐）
	    return api.post(business + 'open/api/iifaa/hostedVp', data)
	},
	iifaaissuerCredentials: (data) => { // 颁发方凭证申请
	    return api.post(business + 'open/api/iifaa/issuerCredentials', data)
	},
	iifaavp: (data) => { // 非托管vp校验
	    return api.post(business + 'open/api/iifaa/vp', data)
	},
	identityPrint: (sn) => { // 用户证件打印
	    return api.get(datahandle + `online/print/identityPrint/${sn}`)
	},
	vidLogin: (data) => { // vid登录（免登）
	    return api.post(business + 'online/login/vidLogin', data)
	},
	iifaaApplyFlag: () => { // iifaa申请标识,0未申领,1已申领
	    return api.get(business + `open/api/iifaa/iifaaApplyFlag`)
	},
	myUnReadCount: () => { // 查询我的行程提醒未读数量
	    return api.get(business + `online/mail/message/myUnReadCount`)
	},
}



